import request from '@/utils/request'

export function addRoleApi(data) {
  return request({
    url: '/role',
    method: 'post',
    data
  })
}

export function deleteRoleApi(params) {
  return request({
    url: '/role',
    method: 'delete',
    params
  })
}

export function updateRoleApi(data) {
  return request({
    url: '/role',
    method: 'put',
    data
  })
}

export function getRoleApi(params) {
  return request({
    url: '/role',
    method: 'get',
    params
  })
}

export function assignRoleMenuApi(data) {
  return request({
    url: '/role-menu',
    method: 'post',
    data
  })
}

export function getCheckKeysApi(params) {
  return request({
    url: '/check-keys',
    method: 'get',
    params
  })
}

export function saveUserRoleApi(data) {
  return request({
    url: '/user-role',
    method: 'post',
    data
  })
}

export function getUserRoleApi(params) {
  return request({
    url: '/user-role',
    method: 'get',
    params
  })
}
